﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaiwuModFramework.Common.Info;

namespace TaiwuModFramework.Common.Abstract {

    /// <summary>
    /// 消息处理客户端
    /// </summary>
    public abstract class AMsgClient {


        protected Action<MsgInfo> Consumer;

        /// <summary>
        ///  发送消息
        /// </summary>
        /// <param name="msg"></param>
        internal abstract void Send(MsgInfo msg);

        /// <summary>
        /// 设置消息的消费方法
        /// </summary>
        /// <param name="consumer"></param>
        internal void SetConsumer(Action<MsgInfo> consumer) {
            Consumer = consumer;
        }
    }
}
